package com.danco.training.zaneuskaya.server;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class MainServerThread {

	public static final int PORT = 1111;

	public static void main(String[] args) {

		try {
			ServerSocket serv = new ServerSocket(PORT);
			System.out.println("initialized");

			while (true) {
				Socket sock = serv.accept();
				System.out.println(sock.getInetAddress().getHostName()
						+ " connected");

				ServerThread server = new ServerThread(sock);

				server.start();

			}
		} catch (IOException e) {
			System.err.println(e);
		}
	}

}
